<template>
	<view class="page_content">
		<view class="item" :class="(index != rows.length - 1) ? 'sep_line' : ''" v-for="(item,index) in rows" :key="index" :data-item="item" @click.stop="itemClick">
			<view class="">{{item.itemName}}</view>
			<uni-icons type="right" size="14"></uni-icons>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				rows:[]
			}
		},
		onLoad() {
			let self = this;
			self.$progressHud.showLoading();
			self.$NetApi.getMethod('/loyu-api/app/item/user/item').then(ok => {
				self.$progressHud.hideLoading();
				self.rows = ok.rows;
			}, fail => {
				self.$progressHud.hideLoading();
				self.$progressHud.showToast(fail.errMsg || '网络错误');
			})
		},
		methods: {
			itemClick(e){
				let item = e.currentTarget.dataset.item;
				this.$Router.push({
					path:'/modules/warnings/pages/warningUser/warningUser',
					query:{
						id:item.itemId
					}
				})
			}
		}
	}
</script>

<style>
	.page_content{
		width: 100%;
		min-height: 100%;
	}
	.item{
		background-color: #FFF;
		padding: 32rpx;
		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		
		font-family: Roboto;
		font-size: 28rpx;
		font-weight: normal;
		line-height: 40rpx;
		letter-spacing: normal;
		color: #000000;
	}
	.sep_line{
		border-bottom: 0.5px solid #e5e5e5;
	}
</style>